<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ include file="/common/common.jsp" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link href="${backPath}/images/skin.css" rel="stylesheet" type="text/css" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<style type="text/css">
<!--
body {
	font-size:12px;
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
	background-color: #EEF2FB;
}
-->
</style>
<script type="text/javascript" language="javascript" src="${cardPath}/common/common.js"></script>
<script type="text/javascript" language="javascript">
	//添加友情链接
	function addLink(){		
		var linkTitle = document.getElementById("link.title").value.trim();
		var linkValue = document.getElementById("link.value").value.trim();
		if(linkTitle.length == 0){
			alert('友情链接名称不能为空!');
			return;
		}	
		if(linkValue.length == 0){
			alert('友情链接地址不能为空!');
			return;
		}
		var form = getLinkForm();	
		form.action = "${backPath}/links/saveLink.action";	
		form.submit();
	}	

	//返回友情链接列表页
	function backToLinkList(){
		var form = getLinkForm();
		form.action = "${backPath}/links/listLinks.action";
		form.submit();		
	}

	//获得友情链接表单对象
	function getLinkForm(){
		return document.getElementById('linkForm');
	}
</script>
</head>
<body>
<form id="linkForm" action="" method="post">

<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td width="17" valign="top" background="${backPath}/images/mail_leftbg.gif"><img src="${backPath}/images/left-top-right.gif" width="17" height="29" /></td>
    <td valign="top" background="${backPath}/images/content-bg.gif"><table width="100%" height="31" border="0" cellpadding="0" cellspacing="0" class="left_topbg" id="table2">
      <tr>
        <td height="31"><div class="titlebt">新增链接</div></td>
      </tr>
    </table></td>
    <td width="16" valign="top" background="${backPath}/images/mail_rightbg.gif"><img src="${backPath}/images/nav-right-bg.gif" width="16" height="29" /></td>
  </tr>
  <tr>
    <td valign="middle" background="${backPath}/images/mail_leftbg.gif">&nbsp;</td>
    <td valign="top" bgcolor="#F7F8F9"><table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td colspan="2" valign="top">&nbsp;</td>      
      </tr>
      <tr>
        <td colspan="2" valign="top">
          <!--HTML-->
          <table class=main_tab id=mainTable cellspacing=0
cellpadding=0 width=100% border=0>
            <!--TBODY-->
            <tbody>
              <tr>
                <td valign=top>
                <table width="98%" height="88" border=0 align="center" cellpadding=0 cellspacing=0>
                  <tbody>
                    <tr>
                      <td height="5" colspan="4"></td>
                    </tr>
                    <tr>
                      <td width="2%" bgcolor="#FAFBFC">&nbsp;</td>
                      <td height="25" colspan="3" align="center" valign="middle" bgcolor="#FAFBFC"><table width="100%" border="0" cellspacing="5" cellpadding="5">
                       
                        <tr>
                          <td width="25%">&nbsp;</td>
                          <td>&nbsp;</td>
                          <td width="26%">&nbsp;</td>
                        </tr>
                        <tr>
                          <td>&nbsp;</td>
                          <td rowspan="3" valign="top">
                        
                      
                            <table id="" width="420px" border="0" cellspacing="2" cellpadding="3">
  <tr>
    <td width="18%"><div align="right">链接名称：</div></td>
    <td width="82%">
      
        <div align="left">
          <input type="text" name="link.title" class="left_txt" id="link.title" style="width:300px"/>
        </div></td>
    </tr>
  <tr>
    <td><div align="right">链接地址：</div></td>
    <td>
      <div align="left">
        <input type="text" name="link.value" class="left_txt" id="link.value" style="width:300px"/>
        </div></td>
  </tr>
</table>                                           </td>
                          <td>&nbsp;</td>
                          <td>&nbsp;</td>
                        </tr>
                        <tr>
                          <td>&nbsp;</td>
                          <td>&nbsp;</td>
                        </tr>
                        <tr>
                          <td>&nbsp;</td>
                          <td>&nbsp;</td>
                        </tr>                  
                      </table></td>
                    </tr>
                    <tr>
                      <td bgcolor="#FAFBFC">&nbsp;</td>
                      <td width="40%" height="25" bgcolor="#FAFBFC">&nbsp;</td>
                      <td width="40%" bgcolor="#FAFBFC">
                      	<input type="button" name="save" id="save" class="left_txt" value="保存"  onclick="addLink()"/>
                      	<input type="submit" name="reset" id="reset" class="left_txt" value="返回友情链接列表页" onclick="backToLinkList()"/>
                      </td>
                      <td width="40%" height="25" bgcolor="#FAFBFC" align="left">                        
                        
                      </td>                      
                    </tr>
                    <tr>
                      <td height="5" colspan="4"></td>
                    </tr>
                  </tbody>
                </table></td>
              </tr>
            </tbody>           
          </table></td>
      </tr>
    </table></td>
    <td background="${backPath}/images/mail_rightbg.gif">&nbsp;</td>
  </tr>
  <tr>
    <td valign="bottom" background="${backPath}/images/mail_leftbg.gif"><img src="${backPath}/images/buttom_left2.gif" width="17" height="17" /></td>
    <td background="${backPath}/images/buttom_bgs.gif"><img src="${backPath}/images/buttom_bgs.gif" width="17" height="17"></td>
    <td valign="bottom" background="${backPath}/images/mail_rightbg.gif"><img src="${backPath}/images/buttom_right2.gif" width="16" height="17" /></td>
  </tr>
</table>
</form>
</body>
</html>